﻿using System;
using System.Collections.Generic;
using System.Text;
using Jw.Core;

namespace Jw.Models
{
    [Module("Pacm")]
    public class q_FileContentService : ServiceBase<q_FileContent>
    {
        protected override bool OnBeforEditDetail(EditEventArgs arg)
        {
            //根据部门编号更新部门名称
            if (arg.row["FileContent_Bmbh"] == null) return base.OnBeforEditDetail(arg);
            string sDwid = arg.row["FileContent_Bmbh"].ToString();
            string sBillNo = arg.row["FileContent_FileBh"].ToString();
            sys_organize organize = new sys_organizeService().GetModel(new ParamQuery().AndWhere("OrganizeCode", sDwid));
            if (organize != null)
            {
                q_LdphbzService objService = new q_LdphbzService();
                arg.row["FileContent_Bmmc"] = organize.OrganizeName;
            }
            return base.OnBeforEditDetail(arg);
        }
    }

    public class q_FileContent : ModelBase
    {

        /// <summary>
        /// 文件编号
        /// <summary>
        [PrimaryKey]
        public string FileContent_FileBh { get; set; }
        /// <summary>
        /// 分类编号
        /// <summary>
        public string FileContent_TypeBh { get; set; }
        /// <summary>
        /// 标题
        /// <summary>
        public string FileContent_Title { get; set; }
        /// <summary>
        /// 内容
        /// <summary>
        public string FileContent_Text { get; set; }
        /// <summary>
        /// 接收部门编号
        /// <summary>
        public string FileContent_Bmbh { get; set; }
        /// <summary>
        /// 接收部门名称
        /// </summary>
        public string FileContent_Bmmc { get; set; }
        /// <summary>
        /// 接收人员
        /// <summary>
        public string FileContent_UserCode { get; set; }
        /// <summary>
        /// 发布人
        /// <summary>
        public string CreatePerson { get; set; }
        /// <summary>
        /// 发布时间
        /// <summary>
        public DateTime? CreateDate { get; set; }
        /// <summary>
        /// 修改人
        /// <summary>
        public string UpdatePerson { get; set; }
        /// <summary>
        /// 修改日期
        /// <summary>
        public DateTime? UpdateDate { get; set; }
        /// <summary>
        /// 审核人
        /// <summary>
        public string ApprovePerson { get; set; }
        /// <summary>
        /// 审核日期
        /// <summary>
        public DateTime? ApproveDate { get; set; }
        /// <summary>
        /// 审核状态
        /// <summary>
        public string ApproveState { get; set; }
        /// <summary>
        /// 审核备注
        /// <summary>
        public string ApproveRemark { get; set; }
        /// <summary>
        /// 附件数量
        /// <summary>
        public string FileContent_Fjsl { get; set; }
        /// <summary>
        /// 有效日期
        /// <summary>
        public DateTime? FileContent_ValidDate { get; set; }
        /// <summary>
        /// 标识
        /// <summary>
        public string FileContent_Flag { get; set; }
        /// <summary>
        /// 是否公开 0 、1
        /// </summary>
        public int? FileContent_IsPublic { get; set; }
    }
}
